Solutions for Comp248 Assignment 2

Function prototype:

a) Format: returnType functionName (Argument List);

Consider the function prototypes of class Painter:

void draw(char c) : has a single character type argument and a void return type.
void left(char c) : has a single character type argument and a void return type.
void right(char c): has a single character type argument and a void return type.
void up(char c)	  : has a single character type argument and a void return type.
void down(char c) : has a single character type argument and a void return type.
void print()      : has an empty argument list and a void return type.


b) UML: Unified Modeling Language.

******************************************************
*                     Painter			     *
******************************************************
*points:char				  	     *
*row:int					     *
*column:int 					     *
******************************************************
*Painter(row:int,column:int,points:char)             *
*draw(c:char) : void				     *
*left(c:char) : void				     *
*right(c:char): void				     *
*up(c:char)	  : void			     *
*down(c:char) : void				     *
*print()      : void				     *
******************************************************